home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / MATHEMAT / STATISTI / 0910.ZIP / STAT-SAK.DOC < prev    next >
Text File  |  1986-11-15  |  16KB  |  450 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                    STAT-SAK
  9.                               The Statistician's
  10.                                Swiss Army Knife
  11.                                  Version 2.1
  12.                                 (c) 1985, 1986
  13.  
  14.                         "One of many STATOOLS(tm)..."
  15.                                       by
  16.  
  17.                               Gerard E. Dallal
  18.                               53 Beltran Street
  19.                               Malden, MA  02148
  20.  
  21.  
  22.  
  23.         STAT-SAK is the STATistician's Swiss Army  Knife:  While  not
  24.         the custom tool for any particular job, it carries out a wide
  25.         variety  of miscellaneous tasks that are not easily performed
  26.         by most large statistical packages.
  27.  
  28.  
  29.  
  30.  
  31.                                     NOTICE
  32.  
  33.         Documentation and original code copyright 1986 by  Gerard  E.
  34.         Dallal.  Reproduction of material for non-commercial purposes
  35.         is   permitted,   without  charge,   provided  that  suitable
  36.         reference is made to STAT-SAK and its author.
  37.  
  38.         Neither STAT-SAK nor its documentation should be modified  in
  39.         any way without permission from the author,  except for those
  40.         changes that  are  essential  to  move  STAT-SAK  to  another
  41.         computer.
  42.  
  43.  
  44.                                   DISCLAIMER
  45.  
  46.         STATOOLS(tm) are provided "as is"  without  warranty  of  any
  47.         kind.  The  entire risk as to the quality,  performance,  and
  48.         fitness  for  intended  purpose  is  with  you.   You  assume
  49.         responsibility  for  the selection of the program and for the
  50.         use of results obtained from that program.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                                                                PAGE 2
  61.  
  62.  
  63.                                  INSTALLATION
  64.  
  65.         STAT-SAK was written for the IBM-PC but few changes should be
  66.         needed to install it on  another  computer.  The  first  DATA
  67.         statement initializes the variables
  68.  
  69.                       IIN -- input unit number (screen)
  70.                      IOUT -- output unit number (screen)
  71.  
  72.  
  73.  
  74.  
  75.                                  DESCRIPTION
  76.  
  77.         STAT-SAK  is  a  tool for anyone who regularly analyzes data.
  78.         It was written under the assumption  that  users  would  have
  79.         access  to  a  "comprehensive" micro or mainframe statistical
  80.         package such as SAS, SPSS-X, BMDP,  or SYSTAT.  STAT-SAK does
  81.         not  perform calculations that require access to the original
  82.         observations.
  83.  
  84.         STAT-SAK performs the following calculations and analyses:
  85.  
  86.          1.  Distributions:
  87.                a.  Normal distribution
  88.                      quantile to probability:  upper-tail
  89.                                                lower-tail
  90.                                                two-tailed
  91.                      probability to quantile
  92.                      [Whenever  a  quantile  of  zero  is  specified,
  93.                       STAT-SAK prompts for three quantities A,B,C and
  94.                       then evaluates A/(B/SQRT(C)).]
  95.                b.  t distribution:  quantile to probability
  96.                                     probability to quantile
  97.                c.  chi-square distribution:  quantile to probability
  98.                                              probability to quantile
  99.                d.  F distribution:  quantile to probability
  100.                                     probability to quantile
  101.                e.  Binomial:  Prob (binomial(n,p) <=,=,>= k)
  102.                f.  Poisson:  Prob (Poisson(mean) <=,=,>= quantile)
  103.  
  104.          2.  Tests of independence/homogeneity of proportions in  two
  105.                dimensional  contingency  tables:  Pearson  chi-square
  106.                statistic,  with Yates's continuity correction in  the
  107.                case of a 2 by 2 table.
  108.  
  109.          3.  Fisher's exact test for 2 by 2 contingency tables.
  110.  
  111.  
  112.         STAT-SAK                                          G.E. Dallal
  113.  
  114.  
  115.  
  116.                                                                PAGE 3
  117.  
  118.  
  119.  
  120.          4.  Mantel-Haenszel   test,   approximate   95-%  confidence
  121.                interval for common odds ratio using equation 10.22 of
  122.                Fleiss (1981).
  123.  
  124.          5.  McNemar's test:  An exact test using the binomial(n,0.5)
  125.                distribution.
  126.  
  127.          6.  Correlation coefficients:
  128.                a.  Test that a population correlation coefficient  is
  129.                      zero.
  130.                b.  Construct  confidence  interval   for   a   single
  131.                      correlation    coefficient   using   a   FORTRAN
  132.                      translation of the BASIC program  of  Maindonald
  133.                      (1984,  p.300)  based  on  an approximation from
  134.                      Winterbottom (1980).
  135.                c.  Compare two independent  correlation  coefficients
  136.                      using Fisher's z transformation.
  137.  
  138.          7.  Bartholomew's  test  for  increasing proportions:  Exact
  139.                P-values are given for 3 or 4 proportions.  For  5  or
  140.                more   proportions,   STAT-SAK   gives   the   P-value
  141.                appropriate for equal column  totals.  This  value  is
  142.                NOT  conservative  for  all  tables.  See  Bartholomew
  143.                (1959a,b).
  144.  
  145.                Since Bartholomew's test is a pool-adjacent-violators
  146.                procedure,  it can  yield "significant"  results even
  147.                when the data show no real trend.  In the table
  148.  
  149.                                   85  15  85
  150.                                   15  85  15
  151.  
  152.                the  first  row  proportion decreases from column 1 to
  153.                column  2;  Bartholomew's  test  fits  the  proportion
  154.                100 (=85 + 15) / 200 (=100 + 100)  to  these  columns.
  155.                The first row proportion then increases  significantly
  156.                as  we  move  to  column  3  and the test statistic is
  157.                significant overall.  In order to alert users to  such
  158.                potential  pitfalls,   STAT-SAK  reports  the  Pearson
  159.                goodness-of-fit   statistic   for    homogeneity    of
  160.                proportions  along  with  the  difference  between the
  161.                Pearson  statistic  and  the  Bartholomew   statistic.
  162.                Although  the reference distribution of the difference
  163.                is not known,  large values are  indicative  of  model
  164.                failure.  A  conservative  test  can  be had using the
  165.                central  chi-square  distribution  with   degrees   of
  166.  
  167.  
  168.         STAT-SAK                                          G.E. Dallal
  169.  
  170.  
  171.  
  172.                                                                PAGE 4
  173.  
  174.  
  175.                freedom equal to the number columns minus 1.
  176.  
  177.          8.  Bartholomew's test for increasing  normal  means:  Exact
  178.                P-values  are  given for 3 or 4 means.  For 5 or more,
  179.                STAT-SAK gives  the  P-value  based  on  equal  column
  180.                totals.  This value is NOT conservative in all cases.
  181.  
  182.                The test for increasing means poses the  same  problem
  183.                as  does  the  test  for proportions:  the data can be
  184.                significant relative to  the  null  hypothesis  of  no
  185.                change even if the monotonicity is seriously violated.
  186.  
  187.                Lack-of-fit   is  assesses  by  partitioning  sums  of
  188.                squares as in a standard analysis of  variance.  Exact
  189.                tests for lack of fit are unavailable,  however, since
  190.                the F-ratios constructed in this manner do not  follow
  191.                central  F  distributions  under their respective null
  192.                hypotheses.  We must be content  with  bounds  on  the
  193.                P-value.
  194.  
  195.                Let  BSS  and  WMS be the between group sum of squares
  196.                and  within  group   mean   square   calculated   when
  197.                performing  a  standard  one-way analysis of variance.
  198.                Let  OBSS  be  the  between  group  sum   of   squares
  199.                calculated  under  order  restriction.  Let 'k' be the
  200.                number of  samples  and  N  be  the  total  number  of
  201.                observations.  Since
  202.  
  203.                     (BSS-OBSS)/(k-1) / WMS   < =                  [1]
  204.                                         (BSS/(k-1)) / WMS         [2]
  205.  
  206.                it  follows  that an upper bound to the P-value can be
  207.                had by comparing [1]  to  the  percentiles  of  the  F
  208.                distribution with k-1 numerator degrees of freedom and
  209.                N-k denominator degrees of freedom.
  210.  
  211.                A lower bound to the P-value is obtained by  assigning
  212.                the difference BSS-OBSS to a single degree of freedom,
  213.                but  it  must  be noted that in the case of two groups
  214.                with equal means, BSS-OBSS equals BSS with probability
  215.                1/2  and  0  with  probability  1/2.   Hence,   for  k
  216.                populations  not  all of whose means are monotonically
  217.                nondecreasing,  the  probability  that  (BSS-OBSS)/WMS
  218.                exceeds  some  particular  value  is no less than HALF
  219.                that given by the  F  distribution  with  1  numerator
  220.                degree  of  freedom  and  N-k  denominator  degrees of
  221.                freedom.
  222.  
  223.  
  224.         STAT-SAK                                          G.E. Dallal
  225.  
  226.  
  227.  
  228.                                                                PAGE 5
  229.  
  230.  
  231.  
  232.                The summary statistics may be read  from  an  external
  233.                file,  one record per sample, each record containing a
  234.                sample's mean, SD or SE, and count separated by one or
  235.                more spaces. (FORTRAN's list directed input is used to
  236.                read the values.)
  237.  
  238.          9.  One sample t test from summary statistics.
  239.  
  240.         10.  Two  sample  t  test  from summary statistics:  includes
  241.                pooled  standard  deviation,   F-ratio   for   testing
  242.                equality of variances, and t tests based on both equal
  243.                and   unequal  (using  Satterthwaite's  approximation)
  244.                variances.  (By  entering  dummy  sample  means,  this
  245.                routine   can   be  used  to  obtain  pooled  standard
  246.                deviations  from  individual  standard  deviations  or
  247.                standard errors.)
  248.  
  249.  
  250.  
  251.         STAT-SAK is a dynamic program.  If there are any capabilities
  252.         you would like to have added,  drop me a note.  I'll consider
  253.         your  suggestions  for  future  versions.  The  criteria  for
  254.         inclusion are:
  255.  
  256.             1.  unavailable in standard statistical packages  or  not
  257.                   easily  obtained  (meaning it's almost easier to do
  258.                   by hand)
  259.  
  260.             2.  does not require the original observations.
  261.  
  262.  
  263.  
  264.  
  265.                             FOR THE FREQUENT USER
  266.  
  267.         At the prompts "Enter 'Q' to quit, press <Enter> to continue"
  268.         and  "Enter  'R'  to  return  to main menu,  press <Enter> to
  269.         continue", any valid STAT-SAK command may be entered, thereby
  270.         bypassing the display of the menu.
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.         STAT-SAK                                          G.E. Dallal
  281.  
  282.  
  283.  
  284.                                                                PAGE 6
  285.  
  286.  
  287.                                   ALGORITHMS
  288.  
  289.         STAT-SAK makes use of the following published routines:
  290.  
  291.         Best, D.J.  and D.E. Roberts  (1975).  Algorithm  AS 91.  The
  292.            percentage  points of the chi-squared distribution.  Appl.
  293.            Statist.,24,385-388.
  294.  
  295.         Bhattacharjee, G.P. (1970).  Algorithm AS 32.  The incomplete
  296.            gamma integral.  Appl. Statist.,19,285-287.
  297.  
  298.         Cran,  G.W.,  K.J. Martin  and  G.E. Thomas  (1977).   Remark
  299.            AS R19  and  Algorithm  AS 109.  A remark on algorithms AS
  300.            63:  The incomplete beta integral,  and AS 64:  Inverse of
  301.            the     incomplete    beta    function    ratio.     Appl.
  302.            Statist.,26,111-114.
  303.  
  304.         Hill,  I.D.  (1973).  Algorithm AS 66.  The normal  integral.
  305.            Appl. Statist.,22,424-427.
  306.  
  307.         Majumder,  K.L.  and  G.P. Bhattacharjee  (1973).   Algorithm
  308.            AS 63.     The    incomplete    beta    integral.    Appl.
  309.            Statist.,22,409-411.
  310.  
  311.         Odeh,  R.E.  and  J.O. Evans  (1974).  Algorithm  AS 70.  The
  312.            percentage  points  of  the  normal  distribution.   Appl.
  313.            Statist.,23,96-97.
  314.  
  315.         and the author's FORTRAN translation of
  316.  
  317.         Pike,  M.C.  and I.D. Hill (1966).  Algorithm 291.  Logarithm
  318.            of the gamma function.  Commun. Ass. Comput. Mach.,9,684.
  319.  
  320.  
  321.  
  322.  
  323.                                   REFERENCES
  324.  
  325.         Bartholomew, D.J. (1959a).  A test of homogeneity for ordered
  326.            alternatives.  Biometrika,46,36-48.
  327.  
  328.         ----------------  (1959b).  A test of homogeneity for ordered
  329.            alternatives.  II.  Biometrika,46,328-335.
  330.  
  331.         Fleiss, Joseph L.  (1981).  Statistical Methods for Rates and
  332.            Proportions, 2-nd ed.  New York:  John Wiley & Sons, Inc.
  333.  
  334.  
  335.  
  336.         STAT-SAK                                          G.E. Dallal
  337.  
  338.  
  339.  
  340.                                                                PAGE 7
  341.  
  342.  
  343.         Maindonald, J.H. (1984).  Statistical Computation.  New York:
  344.            John Wiley & Sons, Inc.
  345.  
  346.         Winterbottom,  Alan  (1980).   Estimation  of  the  bivariate
  347.            normal    correlation    coefficient    using   asymptotic
  348.            expansions.  Comm. in Statist. Simulation and Computation,
  349.            B9, 599-609.
  350.  
  351.  
  352.  
  353.  
  354.                                  STATOOLS(tm)
  355.  
  356.         STAT-SAK is one of many STATOOLS(tm),  a set  of  stand-alone
  357.         programs  designed  to fill in some of the gaps left by major
  358.         statistical program packages such as SAS, SPSS-X,  BMDP,  and
  359.         SYSTAT:
  360.  
  361.         PC-PITMAN,  calculates  observed  significance  levels  using
  362.         recursive   relationships   to   obtain   the   randomization
  363.         (permutation)  distribution of a number of statistics without
  364.         directly examining all possible permutations of the data.  It
  365.         performs one and two  sample  randomization  tests  and  rank
  366.         tests  in  the presence of an arbitrary number of ties in the
  367.         data.
  368.  
  369.         PC-SIZE determines the sample size  requirements  for  single
  370.         factor experiments, two factor experiments, randomized blocks
  371.         designs,  paired t-tests,  and comparison of proportions.  It
  372.         can calculate the power of specific sample sizes as  well  as
  373.         determine the sample size needed to achieve specific power.
  374.  
  375.         PC-MULTI  performs  multiple comparisons using Tukey's honest
  376.         significant differences (studentized range statistic).
  377.  
  378.         FORGET-IT produces Forget-it Plots  (also  known  as  Two-way
  379.         Plots),  a  graphical  device  for displaying the interaction
  380.         structure of a two-way table.
  381.  
  382.         PC-EMS produces tables of expected mean squares for  balanced
  383.         experiments using the Cornfield-Tukey algorithm.
  384.  
  385.         PC-PLAN generates randomization plans.
  386.  
  387.         STRUCTR  fits  structural  relations  when the ratio of error
  388.         variances is known.
  389.  
  390.  
  391.  
  392.         STAT-SAK                                          G.E. Dallal
  393.  
  394.  
  395.  
  396.                                                                PAGE 8
  397.  
  398.  
  399.         PC-AIP fits additive-in-the-probits models to two-dimensional
  400.         contingency tables with ordered column classifications.
  401.  
  402.         To  obtain  a  set  on  three  diskettes  (for the IBM PC and
  403.         compatibles running DOS 2.0 or later versions) containing the
  404.         source code,  executable files,  and user's  guides,  send  a
  405.         check in the amount of $20 to
  406.  
  407.  
  408.                               Gerard E. Dallal
  409.                               53 Beltran Street
  410.                               Malden, MA  02148
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.         STAT-SAK                                          G.E. Dallal
  449.  
  450.